package com.example.llollama.commponent;

/**
 * @Description: TODO
 * @author: lonely
 * @date: 2024年10月18日 23:59
 */
import java.util.function.Function;

public class LocationWeatherFunction implements Function <LocationWeatherFunction.Request, LocationWeatherFunction.Response>{

    // 实现apply方法
    @Override
    public Response apply(Request request) {
        System.out.println(request);
        if(request==null){
            return new Response("request is null");
        }
        if(request.location==null || request.location.equals("")){
            return new Response("地址是空的");
        }
        return new Response("天气一会下雨一会晴天" );
    }

    public record Request(String location){

    }
    public record Response(String msg) {
    }
}

